package com.my.kq.service;

import com.my.kq.dao.DepartmentDao;
import com.my.kq.entity.Department;

import java.util.List;

public class DepartmentService {
    private DepartmentDao departmentDao=new DepartmentDao();
    public Department Demselect(Integer zcnumbr) throws Exception {
       Department dep= departmentDao.depselect(zcnumbr);
        return dep;
    }
//修改
    public void depxg(Integer depId, String education1) throws Exception {
        departmentDao.depxg(depId,education1);
    }
    //查询用户信息
    public List<Department> selectDepartment () throws Exception {

        return   departmentDao.selectdepartment();
    }
    //添加用户信息
    public  void addDepartment(Department dm) throws Exception {
        departmentDao.addDepartment(dm);
    }
    //修改用户信息
    public void updateDepartment(Department dm) throws Exception {
        departmentDao.updateDepartment(dm);
    }
    //删除用户信息
    public  void deleteDepartment(int id) throws Exception {
        departmentDao.deleteDepartment(id);
    }
    //分页查询
    public List<Department> getPage(int pageNo) throws Exception {
       /* List<Department> page=dmd.getPage(pageNo);
        for (Department dmd : page) {
            int classId = dmd.getId();
            Integer id = dmd.getId();
            dmd.setName(String.valueOf(id));
        }
        return page;*/
        List<Department> list = departmentDao.getPage(pageNo);
        return list;
    }
    //查询总条数
    public int  getCount() throws Exception {
        return departmentDao.getCount();
    }

    public Department getDepartment(int id)throws Exception{
        Department department = departmentDao.getDepartment(id);
        return department;
    }
}
